what is wrong with create faction command

Started by SA:MP, May 05, 2023, 05:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SA:MP

what is wrong with create faction command

Hello ,i create this command :


PHP Code:




CMD:fcreate(playeridparams[])

{

    new 
string[128], query[400], fname[32];

    if(
sscanf(params"s[32]"fname)) return SendClientMessage(playerid, -1"USAGE: /fcreate factionname");

    
// GETTING ALL THE FACTIONS CREATED, THEN ADDING 1 TO MAKE THE NEW ONE

    
Total_Factions_Created++;

    
//=====================================================================

    

    // THIS SETS THE FACTIONS NAME TO WHATEVER YOU JUST NAMED IT, PLUS SETS THE ID FOR THE FACTION

    
format(Factions[Total_Factions_Created][FactionName], 64"%s"fname);

    
Factions[Total_Factions_Created][ID] = Total_Factions_Created;

    
//==============================================================================================

    

    // THIS IS JUST TELLING YOU CREATED A FACTION, WITH THE NAME

    
format(stringsizeof(string), "You have created a faction named: %s(ID:%d).",Factions[Total_Factions_Created][FactionName], Factions[Total_Factions_Created][ID]);

    
SendClientMessage(playerid, -1string);

    
//================================================================================================

    

    // THIS IS SETTING ALL THE FACTION NAMES, WILL BE USED LATER FOR EDITTING AROUND

    
format(Factions[Total_Factions_Created][Rank1], 32"Rank 1 - Lowest");

    
format(Factions[Total_Factions_Created][Rank2], 32"Rank 2");

    
format(Factions[Total_Factions_Created][Rank3], 32"Rank 3");

    
format(Factions[Total_Factions_Created][Rank4], 32"Rank 4");

    
format(Factions[Total_Factions_Created][Rank5], 32"Rank 5");

    
//================================================================================

    

    // THIS IS FOR SAVING ALL THE DATA INTO THE MYSQL DATABASE

    
mysql_format(MySQL:Databasequerysizeof(query), "INSERT INTO 'factions' ('ID', 'FactionName', 'FactionLeader', 'Rank1name', 'Rank2name', 'Rank3name', 'Rank4name', 'Rank5name'"

        
Factions[Total_Factions_Created][ID],Factions[Total_Factions_Created][FactionName],Factions[Total_Factions_Created][FactionLeader],Factions[Total_Factions_Created][Rank1],

        
Factions[Total_Factions_Created][Rank2],Factions[Total_Factions_Created][Rank3],Factions[Total_Factions_Created][Rank4],Factions[Total_Factions_Created][Rank5]);

    
mysql_query(MySQL:Databasequery);

    
//=================================================================================

    
return 1;








But when i create a faction , my database is still blank...

Mysql: [img]http://[img]https://imgur.com/LFB0zJC.png[/img][/img]

Source: what is wrong with create faction command